{{- /* This ignress triggers "nginx reload". It is required to update client certififcates or custom headers. */ -}}
{{- define "fake-ingress" }}
{{- $context := index . 0 }}
{{- $name := index . 1 }}
{{- $ingressClass := index . 2 }}
{{- $sourceName := index . 3 }}
{{- $path := "/fake-path" }}
{{- if gt (len .) 4 }}
{{- $path = index . 4}}
{{- end}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ $name }}-{{ $sourceName }}-reload
  namespace: d8-ingress-nginx
  {{- include "helm_lib_module_labels" (list $context ) | nindent 2 }}
spec:
  ingressClassName: {{ $ingressClass }}
  rules:
    - host: reload-{{ $name }}.deckhouse.io
      http:
        paths:
          - path: {{ $path }}
            pathType: ImplementationSpecific
            backend:
              service:
                name: fakeservice
                port:
                  name: https
{{- end }}
